﻿Imports Microsoft.VisualBasic
Imports System.Runtime.Serialization

Namespace DotNetNuke.Modules.IWebCF

    <Serializable(), DataContract()> _
    Public Class UserInfoDataContract
        Implements IWebUserInfoContract

        Private _AffiliateID As Integer
        Private _DisplayName As String
        Private _Email As String
        Private _FirstName As String
        Private _IsSuperUser As Boolean
        Private _LastName As String
        Private _Password As String
        Private _PortalID As Integer
        Private _Roles() As String
        Private _UserID As Integer
        Private _UserName As String


        Public Sub New()

        End Sub

        Public Sub New(ByVal info As UserInfo)
            Me.AffiliateID = info.AffiliateID
            Me.DisplayName = info.DisplayName
            Me.Email = info.Email
            Me.FirstName = info.FirstName
            Me.IsSuperUser = info.IsSuperUser
            Me.LastName = info.LastName
            Me.Password = info.Membership.Password
            Me.PortalID = info.PortalID
            Me.Roles = info.Roles
            Me.UserID = info.UserID
            Me.Username = info.Username
        End Sub

        <DataMember()> _
        Public Property AffiliateID() As Integer Implements IWebUserInfoContract.AffiliateID
            Get
                Return Me._AffiliateID
            End Get
            Set(ByVal value As Integer)
                Me._AffiliateID = value
            End Set
        End Property

        <DataMember()> _
        Public Property DisplayName() As String Implements IWebUserInfoContract.DisplayName
            Get
                Return Me._DisplayName
            End Get
            Set(ByVal value As String)
                Me._DisplayName = value
            End Set
        End Property
        <DataMember()> _
        Public Overloads Property Email() As String Implements IWebUserInfoContract.Email
            Get
                Return Me._Email
            End Get
            Set(ByVal value As String)
                Me._Email = value
            End Set
        End Property
        <DataMember()> _
        Public Overloads Property FirstName() As String Implements IWebUserInfoContract.FirstName
            Get
                Return Me._FirstName
            End Get
            Set(ByVal value As String)
                Me._FirstName = value
            End Set
        End Property
        <DataMember()> _
        Public Overloads Property IsSuperUser() As Boolean Implements IWebUserInfoContract.IsSuperUser
            Get
                Return Me._IsSuperUser
            End Get
            Set(ByVal value As Boolean)
                Me._IsSuperUser = value
            End Set
        End Property

        <DataMember()> _
        Public Overloads Property LastName() As String Implements IWebUserInfoContract.LastName
            Get
                Return Me._LastName
            End Get
            Set(ByVal value As String)
                Me._LastName = value
            End Set
        End Property

        'Membership
        <DataMember()> _
        Public Property Password() As String Implements IWebUserInfoContract.Password
            Get
                Return _Password
            End Get
            Set(ByVal value As String)
                _Password = value
            End Set
        End Property

        <DataMember()> _
        Public Overloads Property PortalID() As Integer Implements IWebUserInfoContract.PortalID
            Get
                Return Me._PortalID
            End Get
            Set(ByVal value As Integer)
                Me._PortalID = value
            End Set
        End Property

        'Profile
        <DataMember()> _
        Public Overloads Property Roles() As String() Implements IWebUserInfoContract.Roles
            Get
                Return Me._Roles
            End Get
            Set(ByVal value() As String)
                Me._Roles = value
            End Set
        End Property

        <DataMember()> _
        Public Overloads Property UserID() As Integer Implements IWebUserInfoContract.UserID
            Get
                Return Me._UserID
            End Get
            Set(ByVal value As Integer)
                Me._UserID = value
            End Set
        End Property

        <DataMember()> _
        Public Overloads Property Username() As String Implements IWebUserInfoContract.Username
            Get
                Return Me._UserName
            End Get
            Set(ByVal value As String)
                Me._UserName = value
            End Set
        End Property


    End Class



End Namespace